// packageSupplyManagement/pages/supplyDetails/supplyDetails.js

Page({

  /**
   * 页面的初始数据
   */
  data: {
<<<<<<< HEAD


  },

=======
    goodsOrderId:0,
      goodsList:[],
    token:'',
    userId:0
  },
//根据订单id显示当前订单
getData(){
  wx.request({
    url: 'http://localhost:8080/source/goodsOrder/'+this.data.goodsOrderId,
    method:'GET',
     header: {
            'authorization': 'Bearer\u0020' + this.data.token
          },
    success:(res)=>{
      console.log(res);
      this.setData({
        goodsList:res.data.data,
      })
    },
  })
 },
>>>>>>> 094150297f7f7390eeb20f6721eaf0bbefdf1068


  // 删除事件
  deleteHandler(event){
    wx.showModal({
      title: '',
      content: '确定要删除此货源吗？',
      complete: (res) => {
        if (res.cancel) {
          
        }
    
        if (res.confirm) {
          // 通过event.currentTarget.dataset获取传递的数据
          let id = event.currentTarget.dataset.id;
          console.log("点击了删除，要删除的ID是：", id);
          wx.request({
            url: 'http://localhost:8081/sfzy/consult/page?id',
<<<<<<< HEAD
            method:'DELETE'
=======
            method:'DELETE',
             header: {
                    'authorization': 'Bearer\u0020' + this.data.token
                  },
>>>>>>> 094150297f7f7390eeb20f6721eaf0bbefdf1068
          })
        }
      }
    })
 },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
<<<<<<< HEAD

=======
    const token= wx.getStorageSync('token');//获取令牌
    const app = getApp();
    console.log(options);
    this.setData({
      goodsOrderId:options.id,
      token:token,
      userId:app.globalData.userInfo.userId,
    });
    this.getData()
>>>>>>> 094150297f7f7390eeb20f6721eaf0bbefdf1068
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})